home *** CD-ROM | disk | FTP | other *** search
/ AmigActive 21 / AACD 21.iso / AACD / Utilities / Ghostscript / src / spprint.h < prev    next >
Encoding:
C/C++ Source or Header  |  2001-01-01  |  3.3 KB  |  84 lines

  1. /* Copyright (C) 1997, 1998, 1999 Aladdin Enterprises.  All rights reserved.
  2.   
  3.   This file is part of AFPL Ghostscript.
  4.   
  5.   AFPL Ghostscript is distributed with NO WARRANTY OF ANY KIND.  No author or
  6.   distributor accepts any responsibility for the consequences of using it, or
  7.   for whether it serves any particular purpose or works at all, unless he or
  8.   she says so in writing.  Refer to the Aladdin Free Public License (the
  9.   "License") for full details.
  10.   
  11.   Every copy of AFPL Ghostscript must include a copy of the License, normally
  12.   in a plain ASCII text file named PUBLIC.  The License grants you the right
  13.   to copy, modify and redistribute AFPL Ghostscript, but only under certain
  14.   conditions described in the License.  Among other things, the License
  15.   requires that the copyright notice and this notice be preserved on all
  16.   copies.
  17. */
  18.  
  19. /*$Id: spprint.h,v 1.2 2000/09/19 19:00:51 lpd Exp $ */
  20. /* Print values in ASCII form on a stream */
  21.  
  22. #ifndef spprint_INCLUDED
  23. #  define spprint_INCLUDED
  24.  
  25. /* Define an opaque type for streams. */
  26. #ifndef stream_DEFINED
  27. #  define stream_DEFINED
  28. typedef struct stream_s stream;
  29. #endif
  30.  
  31. /* Put a character on a stream. */
  32. #define pputc(s, c) spputc(s, c)
  33.  
  34. /* Put a byte array on a stream. */
  35. int pwrite(P3(stream * s, const void *ptr, uint count));
  36.  
  37. /* Put a string on a stream. */
  38. int pputs(P2(stream * s, const char *str));
  39.  
  40. /*
  41.  * Print (a) floating point number(s) using a format.  This is needed
  42.  * because %f format always prints a fixed number of digits after the
  43.  * decimal point, and %g format may use %e format, which PDF disallows.
  44.  * These functions return a pointer to the next %-element of the format, or
  45.  * to the terminating 0.
  46.  */
  47. const char *pprintg1(P3(stream * s, const char *format, floatp v));
  48. const char *pprintg2(P4(stream * s, const char *format, floatp v1, floatp v2));
  49. const char *pprintg3(P5(stream * s, const char *format,
  50.             floatp v1, floatp v2, floatp v3));
  51. const char *pprintg4(P6(stream * s, const char *format,
  52.             floatp v1, floatp v2, floatp v3, floatp v4));
  53. const char *pprintg6(P8(stream * s, const char *format,
  54.             floatp v1, floatp v2, floatp v3, floatp v4,
  55.             floatp v5, floatp v6));
  56.  
  57. /*
  58.  * The rest of these printing functions exist solely because the ANSI C
  59.  * "standard" for functions with a variable number of arguments is not
  60.  * implemented properly or consistently across compilers.
  61.  */
  62. /* Print (an) int value(s) using a format. */
  63. const char *pprintd1(P3(stream * s, const char *format, int v));
  64. const char *pprintd2(P4(stream * s, const char *format, int v1, int v2));
  65. const char *pprintd3(P5(stream * s, const char *format,
  66.             int v1, int v2, int v3));
  67. const char *pprintd4(P6(stream * s, const char *format,
  68.             int v1, int v2, int v3, int v4));
  69.  
  70. /* Print a long value using a format. */
  71. const char *pprintld1(P3(stream * s, const char *format, long v));
  72. const char *pprintld2(P4(stream * s, const char *format, long v1, long v2));
  73. const char *pprintld3(P5(stream * s, const char *format,
  74.              long v1, long v2, long v3));
  75.  
  76. /* Print (a) string(s) using a format. */
  77. const char *pprints1(P3(stream * s, const char *format, const char *str));
  78. const char *pprints2(P4(stream * s, const char *format,
  79.             const char *str1, const char *str2));
  80. const char *pprints3(P5(stream * s, const char *format,
  81.             const char *str1, const char *str2, const char *str3));
  82.  
  83. #endif /* spprint_INCLUDED */
  84.